import 'package:fish_redux/fish_redux.dart';
import 'package:school_safe_teacher/homework/action.dart';

import 'entity/news_entity.dart';

//TODO replace with your own action
enum HomePageAction { action,
  success,
  complete,
onRefresh,
onLoad,
  onChooseClassSuccess,}

class HomePageActionCreator {
  static Action onAction() {
    return const Action(HomePageAction.action);
  }
  static Action onSuccess(List<NewsEntity> list) {
    return Action(HomePageAction.success,payload: list);
  }
  static Action onComplete() {
    return Action(HomePageAction.complete);
  }

  static Action onRefresh() {
    return Action(HomePageAction.onRefresh);
  }

  static Action onLoad(int page) {
    return Action(HomePageAction.onLoad, payload: page);
  }
  static Action onChooseClassSuccess(String classID){
    return Action(HomePageAction.onChooseClassSuccess, payload: classID);
  }
}
